package com.bestvike.stone.core.util.area;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import lombok.ToString;

/**
 * 街道级行政区
 * Created by 许崇雷 on 2019-01-09.
 */
@Data
@EqualsAndHashCode(exclude = "county")
@ToString(exclude = "county")
public final class Town {
    @JSONField(ordinal = 1)
    private final String code;
    @JSONField(ordinal = 2)
    private final String name;
    @Setter(AccessLevel.PACKAGE)
    @JSONField(serialize = false, deserialize = false)
    private transient County county;

    public Town(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
